<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form">
        
        <div class="layui-form-item">
            <label class="layui-form-label">代金券类型</label>
            <div class="layui-input-block">
                <select lay-filter="cash_card_type" name="card_type" id="cash_card_type" lay-verify="required" data-select="{:url('cashcard.cate/get_card_type')}" data-fields="id,title">
                </select>
            </div>
        </div>

        <div class="layui-form-item" id="form-type">
            <label class="layui-form-label">商品类型</label>
            <div class="layui-input-block">
                <select lay-filter="related_category" name="related_cate" data-select="{:url('shop.cate/index')}" data-fields="id,title">
                </select>
            </div>
<!--            <div class="layui-input-block">-->
<!--                <input type="text" name="related_category" class="layui-input"  placeholder="请输入关联商品类型" value="">-->
<!--            </div>-->
        </div>
<!--        <div class="layui-form-item">-->
<!--            <label class="layui-form-label">关联商户(可多选,空值为不限制)</label>-->
<!--            <div class="layui-input-block">-->
<!--                <input type="text" name="related_merchant" class="layui-input"  placeholder="请输入关联商户(可多选,空值为不限制)" value="">-->
<!--            </div>-->
<!--        </div>-->
        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
                <input type="text" name="title" class="layui-input"  placeholder="请输入该种代金券名称" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">该种代金券数量</label>
            <div class="layui-input-block">
                <input type="number" name="num" class="layui-input"  placeholder="请输入该种代金券数量" value="1">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">管理员授权</label>
            <div class="layui-input-block">
                {foreach $branch_list as $branch_info}
                <p>
                    <input type="checkbox" lay-filter = 'branch' data-value="{$branch_info.branch_id}"
                           title="{$branch_info.name}">
                    <br/>
                    {foreach $branch_info.admins as $admin_info}
                        <input type="checkbox" name="card_author[{$admin_info.id}]" lay-skin="primary"
                               class="branch_{$branch_info.branch_id}"
                            title="{$admin_info.username}[{$admin_info.remark}]">
                    {/foreach}
                </p>
                {/foreach}
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">每个管理员最多分发数量</label>
            <div class="layui-input-block">
                <input type="number" name="num_person" class="layui-input"  placeholder="请输入数量" value="1">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">过期时间</label>
            <div class="layui-input-block">
                <input type="text" name="expire_time" class="layui-input" id="expire_at"  placeholder="请输入到期时间" value="">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">使用条件（满多少减）</label>
            <div class="layui-input-block">
                <input type="text" name="min_order_price" class="layui-input"  placeholder="请输入最小订单使用金额" >
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">优惠金额</label>
            <div class="layui-input-block">
                <input type="text" name="cashcard_price" class="layui-input"  placeholder="请输入金额" >
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">使用说明</label>
            <div class="tips-box"></div>
            <div class="layui-input-block">
                <i class="layui-btn layui-btn-success tips-add">+</i>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">注意事项</label>
            <div class="attention-box"></div>
            <div class="layui-input-block">
                <i class="layui-btn layui-btn-success attention-add">+</i>
            </div>
        </div>

        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>

    </form>
</div>

<style>
    #expire_at{
        display: block;
        position: relative;
    }
    /*.layui-input{*/
    /*    width: 80%;*/
    /*    display: inline;*/
    /*}*/
    .tips-box>.layui-input-block .layui-input{
        margin-bottom: 10px;
        width: 80%;
        display: inline;
    }
    .attention-box>.layui-input-block .layui-input{
        margin-bottom: 10px;
        width: 80%;
        display: inline;
    }
    .layui-input-block i{
        margin-top: -2px;
    }
</style>
<script>
    var tips_arr = [''];
    var attention_arr = [''];
</script>